package cn.lili.modules.system.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.system.entity.dos.Region;
import cn.lili.modules.system.entity.dos.RegionYbj;
import cn.lili.modules.system.fallback.RegionFallback;
import cn.lili.modules.system.fallback.RegionQddFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.SYSTEM_SERVICE, contextId = "region", fallback = RegionFallback.class)
public interface IRegionClient {

    @GetMapping("/feign/region/{regionId}")
    Region getRegionById(@PathVariable("regionId") String regionId);

    /**
     * 根据ID获取区域列表
     *
     * @param regionId 区域ID
     * @return 区域信息
     */
    @GetMapping("/feign/region/getRegionByParentId/{regionId}")
    List<Region> getRegionByParentId(@PathVariable("regionId")String regionId);

    /**
     * 获取所有区域信息
     * @return 区域信息
     */
    @GetMapping("/feign/region/getRegionList")
    List<Region> getRegionList();

}
